<script lang="ts"  setup>
import { reactive } from 'vue'
import { OPTIONS_CATEGOEY } from '@/utils/const.js'
import { codeToText } from 'element-china-area-data'


//定义时间传递对象
const $emits = defineEmits(['searchParamsBtnEmits', 'resetParamsBtnEmits'])

// interface searchForm {
//   /** admin 或 editor */
//   username: string
//   /** 密码 */
//   password: string
//   /** 验证码 */
//   code: string
// }

const searchForm = reactive({
  materialCode: '',
  engineeringClass: '',
  area:''

})

//搜索用户信息参数传递
const searchBtn = () => {
  $emits('searchParamsBtnEmits', searchForm)
}

const resetBtn = () => {
  Object.assign(searchForm, {
    deptName: '',
    status: '',
  })
  $emits('resetParamsBtnEmits')
}
</script>

<template>
  <div class="search">
    <el-form :model="searchForm" >
      <el-row>
 
        <el-col  :span="6" >
          <el-form-item label-width="100px" label="物料编码" >
            <el-input v-model="searchForm.materialCode"  />
          </el-form-item>
        </el-col>
        <el-col style="margin-left: 20px;"  :span="6" >
          <el-form-item label-width="100px" label="工程类别" >
            <el-input v-model="searchForm.engineeringClass"  />
          </el-form-item>
        </el-col>
        <el-col style="margin-left: 20px;"  :span="6" >
          <el-form-item label-width="100px" label="区域" >
            <el-input v-model="searchForm.area"  />
          </el-form-item>
        </el-col>
        <el-button  style="margin-left: 20px;" type="primary" @click="searchBtn">
          <el-icon>
            <Search />
          </el-icon>
          <span>查询</span>
        </el-button>
      </el-row>
    </el-form>
  </div>
</template>

<style scoped lang="less">
.search {
  //.el-form-item {
  //  font-weight: 700;
  //  padding: 0 30px 0 30px;
  // }

  margin-top: 20px;

  .el-col {
    margin-bottom: 20px;
  }

  .el-button {
    width: 80px;
  }
}
</style>
